#ifndef __DXTEXTURE_H__
#define __DXTEXTURE_H__

#include <D3dx9mesh.h>


class CDXTexture
{
	friend class CDXMesh;
public:
	CDXTexture() : m_pTexture(0),
				m_pMaterial(0)
	{}

	~CDXTexture();

	bool init(const D3DXMATERIAL tempMaterial);
	void render();
	
	
private:
	LPDIRECT3DTEXTURE9	m_pTexture;					//!< Textures
	D3DMATERIAL9*		m_pMaterial;				//!< Materials
	static const unsigned int m_uiMaxMipmapLevel = 4;

	void				setMaterialInfo(const D3DMATERIAL9& tempMaterial);

	bool				extractMaterialInfo(const D3DXMATERIAL tempMaterial);
	bool				extractTextureInfo(const LPCTSTR filename);
	
	void				setTexture();
	void				setMaterial();
};



#endif // __DXTEXTURE_H__